//
//  CMBleTools.h
//  BluetoothTest
//
//  Created by Chen Ming on 2017/11/28.
//  Copyright © 2017year Bioland. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Macro.h"


typedef enum{
    BrandStyle,
    InstrumentStyle
} ModelStyle;

typedef enum{
    InformationPacketStyle,
    DataPacketStyle,
    OverPacketStyle
} PacketStyle;

typedef enum{
    preInfoPacketStyle,
    preDataPacketStyle,
    preStartPacketStyle,
    preProcessPacketStyle,
    preOverPacketStyle
} prePacketStyle;

@interface CMBleTools : NSObject

/**
 * Convert hex data to an array
 *
 * @param data Hexadecimal data
 * @return Converted array
 */
+ (NSMutableArray *)convertDataToHexStr:(NSData *)data;
/**
 * Convert hexadecimal numbers to decimal numbers
 * @return Returned data
 */
+ (NSString *)handStrtoulStr:(NSString *)str;
//Convert decimal to hexadecimal   Incoming int   return NSString
+ (NSString *)ToHex:(int)tmpid;
//Convert hexadecimal to decimal    return NSInteger
+ (NSInteger)getDecimalByHex:(NSString *)hex;
//Incoming string    return NSData
+ (NSData *)getCheckSum:(NSString *)byteStr;
/** rounding */
+ (NSString *)notRounding:(float)price afterPoint:(int)position;
//Incoming string    return string      Slimming for VC
+ (NSString *)ReturnTureBrandOrInstrument:(NSString *)string AndmodelStyle:(ModelStyle)modelStyle;
/**String to ASCII code */
+(NSString *)StringToASCII:(NSString *)string;
/** Send a blood glucose packet */
+(NSData *)SendDataWithCurrentDate:(PacketStyle)style;
/** Send blood pressure data packet */
+(NSData *)pressureSendDataWithCurrentDate:(prePacketStyle)style;


+(NSString*)serializeNSData:(NSData*)data;


+(NSString*)serializeNSDataDisplay:(NSData*)data;
@end
